package com.sig.map;

import java.util.ArrayList;
import java.util.List;

import com.sig.formes.Point;

public class Chemin {
	Point point1 = null;
	Point point2 = null;
	
	Integer id = null;
	
	List<Polygone> polygones = new ArrayList<Polygone>();
	List<Chemin> chemins = new ArrayList<Chemin>();
	
	public Point getPoint1() {
		return point1;
	}

	public void setPoint1(Point point1) {
		this.point1 = point1;
	}

	public Point getPoint2() {
		return point2;
	}

	public void setPoint2(Point point2) {
		this.point2 = point2;
	}
	
	public void addPoint(Point p){
		if(point1 == null)
			point1 = p;
		else if(point2 == null)
			point2 = p;
	}
	
	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public List<Polygone> getPolygones() {
		return polygones;
	}

	public void setPolygones(List<Polygone> polygones) {
		this.polygones = polygones;
	}
	
	public void addPolygone(Polygone polygone) {
		this.polygones.add(polygone);
	}
	
	public String toString(){
		return "Chemin id="+id+" ["+point1.toString()+" | "+point2.toString()+"]";
	}

	public void addChemin(Chemin chemin) {
		chemins.add(chemin);
		
	}

	public List<Chemin> getChemins() {
		return chemins;
	}

	public void setChemins(List<Chemin> chemins) {
		this.chemins = chemins;
	}
	
	
}
